from django.db import models

class StockData(models.Model):
    ts_code = models.CharField(max_length=20)
    trade_date = models.DateField()
    open = models.FloatField()
    high = models.FloatField()
    low = models.FloatField()
    close = models.FloatField()
    pre_close = models.FloatField()
    change = models.FloatField()
    pct_chg = models.FloatField()
    vol = models.FloatField()
    amount = models.FloatField()

    def __str__(self):
        return f"{self.ts_code} - {self.trade_date}"